package com.app.common

import android.app.Activity
import android.content.Intent
import androidx.fragment.app.Fragment

inline fun Activity.openActivity(activity: Class<out Activity>){
    openActivity(activity){}
}

inline fun Fragment.openActivity(activity: Class<out Activity>){
    openActivity(activity){}
}

inline fun Activity.openActivity(activity: Class<out Activity>, crossinline block: Intent.()->Unit){
    val intent = Intent(this,activity)
    block(intent)
    startActivity(intent)
}
inline fun Fragment.openActivity(activity: Class<out Activity>, crossinline block: Intent.()->Unit){
    val intent = Intent(requireContext(),activity)
    block(intent)
    startActivity(intent)
}